package com.arrogames.lib.ash.movement {
	import ash.tools.ListIteratingSystem;
	
	public class MovementSystem extends ListIteratingSystem {
		
		public function MovementSystem() {
			super(MovementNode, movementNodeUpdate);
		}
		
		private function movementNodeUpdate(node:MovementNode, time:Number):void {
			node.position.x += node.speed.value * Math.sin(node.direction.radians) * time;
			node.position.y += node.speed.value * Math.cos(node.direction.radians) * time;
		}
	}
}